package xiegd.com.springbootuse.demo;

import java.util.stream.Stream;

/**
 * @Author: xieguangda
 * @Description:
 * @Date: 2023/10/10 9:16
 */
public class MyTest {
    public static void main(String[] args) {
        Stream<Integer> stream2 = Stream.iterate(0, (x) -> x + 3).limit(4);
        stream2.forEach(System.out::println); // 0 2 4 6 8 10

        Stream<Double> stream3 = Stream.generate(Math::random).limit(3);
        stream3.forEach(System.out::println);
    }



}
